package agents.interaction;

import game.constants.ReferenceAgent;
import interfaces.impl.HumanInteraction;
import objects.WorldObject;
import universe.Universe;
import actions.ActionUnEquipe;
import extra.ObjectId;

public class InteractionUnEquipeObject extends HumanInteraction{
	
	ObjectId objectIdToUnEquipe;

	@Override
	public void initializeParametersList() {
		objectIdToUnEquipe= new ObjectId();
		addParameter(objectIdToUnEquipe);
		
	}

	@Override
	public void initializeActionList() {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void initializeSpecialFeatures() {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void initializeName() {
		name="Unequipe";
		
	}

	@Override
	public void initializeId() {
		this.id=ReferenceAgent.AGENT_HUMAN_INTERACTION_UNEQUIPE_OBJECT;
		
		
	}

	@Override
	public void updateChild(WorldObject object, Universe universe, double time) {
		WorldObject objectToUnEquipe = universe.getObject(objectIdToUnEquipe.getObjectId());
		if(objectToUnEquipe==null){
			isActive=false;
			return;
		}
		
		ActionUnEquipe actionUnEquipe = new ActionUnEquipe();
		actionUnEquipe.setSource(object);
		actionUnEquipe.setTarget(objectToUnEquipe);
		universe.setAction(actionUnEquipe);
		isActive=false;
		
	}
	
	

}
